import request from '@/utils/request'

// 获取文章评论
export const getComment = params => {
  return request({
    method: 'get',
    url: '/v1_0/comments',
    params
  })
}

// 评论点赞
export const addCommentLike = data => {
  return request({
    method: 'post',
    url: '/v1_0/comment/likings',
    data
  })
}

// 评论取消点赞
export const deleteCommentLike = target => {
  return request({
    method: 'delete',
    url: `/v1_0/comment/likings/${target}`
  })
}

// 发布评论
export const postComment = data => {
  return request({
    method: 'post',
    url: '/v1_0/comments',
    data
  })
}
